package com.yzh.array02;

import java.util.Arrays;

/**
 * @author 于振晗
 * @title: Test02
 * @description: TODO Arrays类
 * @date 2020年08月18日
 * @path com.yzh.array02;
 */
public class Test02 {
    public static void main(String[] args) {
        int [] arrs1 = {75,87,56,45,89,100,76,34,97};
        int [] arrs2 = {75,87,56,45,89,100,76,34,97};
        //数组输出
        System.out.println(Arrays.toString(arrs1));
        //数组的查找
        //如果存在返回下标
        Arrays.binarySearch(arrs1,100);
        //数组的填充
        //所有值全部都被改变为填充的值
//        Arrays.fill(arrs1,10);
        System.out.println(Arrays.toString(arrs1));

        //数组拷贝
        int[] ints = Arrays.copyOf(arrs1, arrs1.length * 2);
        System.out.println(Arrays.toString(ints));

        //数组的比较
        boolean equals = Arrays.equals(arrs1, arrs2);
        System.out.println(equals);
    }
}
